﻿CREATE PROCEDURE [dbo].[ReportEntriesPastDue]
AS
BEGIN
SELECT u.FullName, p.Name as ProjectName, c.Name as CategoryName, e.EntryDate
FROM EntryLog e INNER JOIN
	 Users u ON e.UserID = u.UserID INNER JOIN
	 Categories c ON e.CategoryID = c.CategoryID INNER JOIN
     Projects p ON e.ProjectID = p.ProjectID AND e.EntryDate > p.EstCompletionDate
WHERE (e.HasBeenBilled = 0) AND (u.IsActive = 1) AND (p.ProjectTypeID <> 3)
END